#ifndef SDK_OHOS_OHOS_AUDIO_SOURCE_H_
#define SDK_OHOS_OHOS_AUDIO_SOURCE_H_

#include "api/ohos_audio_source_interface.h"
#include "api/media_stream_interface.h"
#include "rtc_base/logging.h"
#include "api/ohos_peer_connection_factory_interface.h"

namespace ohoswebrtc {

class OHOSAudioSource : public OHOSAudioSourceInterface {
  public:
    
    OHOSAudioSource(rtc::scoped_refptr<webrtc::AudioSourceInterface> audio_source, rtc::scoped_refptr<OHOSPeerConnectionFactoryInterface> peer_connection_factory);

    virtual ~OHOSAudioSource();
  
    /**
    * The native AudioSourceInterface passed in or created during construction.
    */
    rtc::scoped_refptr<webrtc::AudioSourceInterface> audio_source() {
      return audio_source_;
    }
    
    /** The state of the audio source. */
    OHOSMediaSourceState state() const override {
      return static_cast<OHOSMediaSourceState>(audio_source_->state());
    }

  private:
    rtc::scoped_refptr<webrtc::AudioSourceInterface> audio_source_;
    rtc::scoped_refptr<OHOSPeerConnectionFactoryInterface> peer_connection_factory_;
};
}

#endif